//
//  ReadAppBookFirendVC.m
//  LiteraryTune
//
//  Created by mack on 2018/11/18.
//  Copyright © 2018 cxd. All rights reserved.
//

#import "ReadAppBookFirendVC.h"
#import <WebKit/WebKit.h>

@interface ReadAppBookFirendVC ()
@property (strong, nonatomic) WKWebView *webView;
@property (strong, nonatomic) UIScrollView *scroll;
@end

@implementation ReadAppBookFirendVC

- (void)viewDidLoad {
    [super viewDidLoad];
//    self.webView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
//    self.webView.backgroundColor = [UIColor whiteColor];
////    self.webView.navigationDelegate = self;
//    [self.view addSubview:self.webView];
//    self.title = @"书友会";
//    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://taiyuan.zxhsd.com"]]];
//    [self addImageOnViewWithImage];

}
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self addImageOnViewWithImage];


}
-(void)addImageOnViewWithImage{
    [self.scroll removeFromSuperview];
    
    self.scroll=[[UIScrollView alloc]initWithFrame:self.view.frame];
    self.scroll.showsVerticalScrollIndicator=NO;
    [self.view addSubview:self.scroll];
    CGFloat imageH;
    UIImage *image;
    image=[UIImage imageNamed:@"book_friend"];
    imageH= self.view.frame.size.width * (image.size.height / image.size.width);
//    if(self.view.frame.size.width==320){
//
//        image=[UIImage imageNamed:@"hehuorenSe"];
//        imageH=image.size.height;
//    }else if(self.view.frame.size.height==812){//适配iphoneX
//
//        image=[UIImage imageNamed:@"hehuorenPX"];
//        imageH=image.size.height;
//
//        }
    self.scroll.contentSize=CGSizeMake(0, imageH+50);
    UIImageView *imagev=[[UIImageView alloc]initWithFrame:CGRectMake(0,0,self.view.frame.size.width, imageH)];
    imagev.contentMode = UIViewContentModeScaleAspectFit;
//    imagev.clipsToBounds = YES;
    imagev.image=image;
    [self.scroll addSubview:imagev];
    

    
}

@end
